package cn.timeapi.example;

import cn.timeapi.sdk.Api;
import cn.timeapi.sdk.Appliction;
import cn.timeapi.sdk.data.Request;
import cn.timeapi.sdk.data.Response;

import java.util.Map;

/**
 * @description: TimeApi 使用SDK 地址转换Json 例子
 * @author: Vincent Vic
 * @email: vincent-vic@qq.com
 * @time: 2020/7/27 21:07
 */
//本类设置true为Api平台主调函数，其他通过Appliction接口的实现类需要设置false
@Api(value = true)
public class example2 implements Appliction {

    @Override
    public Response apiApplication(Request request) throws Exception{
        Response response = null;
        //通过Request 的 Param Map表得到自定义属性
        Map map = request.getParam();
        if (map.containsKey("address")){
            //调用功能解析,并得到结果返回包
            response =  AddressResolutionUtil.addressResolutionSetList(String.valueOf(map.get("address")));

        }
        return response;
    }
}
